<template>
    <div class="fail">
        <div class="user-avatar-wrap">
            <UserAvatar :level="1" :totalLevel="5"/>
        </div>
        <div class="fail-bg"></div>
        <button class="btn-over" @click="gameOver">结束挑战</button>
    </div>
</template>

<script>
    import UserAvatar from 'components/UserAvatar'

    export default {
        name: "fail",
        components:{
            UserAvatar
        },
        methods:{
            gameOver(){
                this.$emit('gameOver')
            }
        }
    }
</script>

<style scoped lang="less">
    .fail{
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 99;
        overflow: hidden;
    }
    .user-avatar-wrap{
        width: 100px;
        height: 100px;
        padding-top: 0.5rem;
        margin: 0 auto;
    }
    .fail-bg{
        width: 6rem;
        height: 6rem;
        margin: 0.3rem auto;
        background:url("../assets/combat/failure.png") no-repeat center center;
        background-size: cover;
    }
    .btn-over{
        width: 4.5rem;
        height: 1rem;
        line-height: 1rem;
        color: #FFFFFF;
        background-color: #ffcd60;
        font-size: 0.4rem;
        border-radius:0.5rem;
        position: absolute;
        bottom: 1rem;
        left: 1.5rem;
        box-shadow: 0 2px 3px #FFFFFF;
    }
</style>
